import 'package:flutter/material.dart';

class MyApp13 extends StatelessWidget {
  const MyApp13({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      //导航条
      appBar: AppBar(
        title: const Text(
          'ListView初体验',
          style: TextStyle(color: Colors.white, fontSize: 20),
        ),
        backgroundColor: Colors.pink,
        centerTitle: true,
      ),
      //主体区域
      body: ListView(
        //滚动方向
        scrollDirection: Axis.vertical, //滚动方向
        //滚动方向是否反向
        // reverse: true,
        // physics: NeverScrollableScrollPhysics(),//禁止滚动
        children: [
          //
          Container(
            //
            color: Colors.red,
            height: 100,
            child: const Text('我是容器1'),
          ),
          Container(
            color: Colors.blue,
            height: 150,
            child: const Text('我是容器2'),
          ),
          Container(
            color: Colors.green,
            height: 200,
            child: const Text('我是容器3'),
          ),
          Container(
            color: Colors.yellow,
            height: 250,
            child: const Text('我是容器4'),
          ),
          Container(
            color: Colors.orange,
            height: 300,
            child: const Text('我是容器5'),
          ),
          Container(
            color: Colors.cyan,
            height: 350,
            child: const Text('我是容器6'),
          ),
        ],
      ),
    );
  }
}
